<?php
require_once './header.php';
?>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="initial-scale=1.0,width=device-width,user-scalable=0,maximum-scale=1.0"/>
    <title>保存/分享</title>
    <link rel="stylesheet" href="./css/base.css">
    <link rel="stylesheet" href="./css/index.css">
    <script>
        function adapte() {//适配
            var designWidth = 1080, rem2px = 100;
            document.documentElement.style.fontSize = window.innerWidth / designWidth * rem2px + "px";
        }
        adapte();
    </script>
</head>
<body>
<div class="save-share">
    <?php
    if (isset($_SESSION['f-uid']) && isset($_SESSION['f-fid']) && $_SESSION['make-done-poster']) {
        ?>
        <img src="<?= $_SESSION['make-done-poster'] ?>?r=<?= rand(10, 100) ?>" alt="">
        <?php
    } else {
        ?>
        <img src="./img/img1.jpg" alt="">
        <?php
    }
    ?>
    <div class="btns">
        <button class="save"><a href="javascript:;" onclick="addImInTa(<?= $_SESSION['f-uid'] ?>, '<?= $_SESSION['make-done-poster'] ?>', 'save')">保存到手机</a></button>
        <p>保存到手机（<?= $_SESSION['poster-size-kb'] ?>KB，jpg格式，可自己发送到朋友圈或好友）</p>
        <button class="share-link"><a href="javascript:;" onclick="addImInTa(<?= $_SESSION['f-uid'] ?>, '<?= $_SESSION['make-done-poster'] ?>', 'share')">保存生成链接分享</a>
        </button>
        <p>生成链接分享（以网页链接形式分享到朋友圈或好友）</p>
    </div>
</div>

<script src='./script/jquery.js'></script>
<script src='./script/index.js'></script>
</body>
</html>
<?php
require_once './footer.php';